package com.conan.zone.framework.dao;

import java.util.List;

import com.conan.zone.framework.exception.DaoException;
import com.conan.zone.framework.model.ParamBean;

/**
 * 
 * @author jpeng
 *
 * @param <T>
 */
public interface IAbstractDao <T extends ParamBean>{
	
	
	public void init();
	
	/**
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public T selectByPrimaryKey(Long pk) throws DaoException;

	/**
	 * 
	 * @param t
	 * @param rowStart
	 * @param rowEnd
	 * @return
	 * @throws Exception
	 */
	public List<T> selectByCondition(T t , int rowStart, int rowEnd) throws DaoException;
	
	/**
	 * 
	 * @param t
	 * @param rowStart
	 * @param rowEnd
	 * @return
	 * @throws Exception
	 */
	public List<T> selectAll(T t)  throws DaoException;
	
	
	
	/**
	 * 
	 * @param t
	 * @return
	 * @throws Exception
	 */
	public Integer getTotalByCondition(T t) throws DaoException;

	/**
	 * 
	 * @param t
	 * @return
	 * @throws Exception
	 */
	public Integer insertObj(T t) throws DaoException;
	/**
	 * 
	 * @param t
	 * @return
	 * @throws Exception
	 */
	public Integer updateByPrimaryKey(T t) throws DaoException;

	/**
	 * 
	 * @param t
	 * @return
	 * @throws Exception
	 */
	public Integer deleteByPrimaryKey(Long pk) throws DaoException;
}

